

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    .main {
      width: 660px;
      height: 660px;
      background-image: url('./images/panze.png');
      margin: 100px auto;
      position: relative;
    }
    .zhizhen {
      width: 338px;
      height: 338px;
      background-image: url('./images/zhizhen.png');
      background-repeat: no-repeat;
      background-position: center top;
      position: absolute;
      top: 129px;
      left: 152px;
      transition: transform 500ms linear;
    }
    .begin {
      width: 138px;
      height: 138px;
      position: absolute;
      top: 227px;
      left: 252px;
      border-radius: 50%;
      /* background-color: rgba(255,0,0,.5); */
    }
  </style>
</head>
<body>
  <div class="main">
    <div class="zhizhen"></div>
    <div class="begin"></div>
  </div>
</body>
<script>
/*
 抽奖只能抽一次，
 当点击抽奖的时候，指针随机360度转。
 点了一次之后不能抽了
*/
var begin=document.querySelector('.begin');
var zhizhen=document.querySelector('.zhizhen');
// 还没点的时候
var isa=false;
begin.addEventListener('click',function fn(){
  begin.removeEventListener('click',fn);
  // false证明没有点击过，就可以点
   var r=Math.random()*360;
   zhizhen.style.transform='rotate('+r+'deg';

})



</script>
</html>
